#--*-- coding:utf-8 --*--

import sys
import os
from pyqt4_pyside import *

class ErrorInfoWidget(QtGui.QWidget):
    def __init__(self,  parent=None):
        super(ErrorInfoWidget, self).__init__(parent)
        hbox = QtGui.QHBoxLayout(self)
        hbox.setContentsMargins(0, 0, 0, 0)
        hbox.setSpacing(0)
        self.infoLabel = QtGui.QLabel()
        self.hideButton = QtGui.QToolButton()
        hbox.addWidget(self.infoLabel)
        hbox.addWidget(self.hideButton)
        
        self.setStyleSheet("background-color:rgb(255,255,170)")
        self.infoLabel.setStyleSheet("color:red")
        
        self.hideButton.clicked.connect(self.hide)
        
    def setInfoText(self,  text):
        self.infoLabel.setText(text)

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    w = ErrorInfoWidget()
    w.setInfoText(u"hello, 你好")
    w.show()
    sys.exit(app.exec_())
